﻿Imports Utilitario
Imports Negocio
Imports Entidad
Public Class frmINVConteo
    Public nroConteo As String


    Private Sub frmINVConteo_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If nroConteo = "1" Then
            Me.Text = "Primer Conteo"
        End If
        If nroConteo = "2" Then
            Me.Text = "Segundo Conteo"
        End If
        If nroConteo = "3" Then
            Me.Text = "Tercer Conteo"
        End If
    End Sub

    Private Sub TextBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
        If e.KeyCode = Keys.Enter Then
            Dim valor As Array = TextBox1.Text.Split(".")
            Dim articulo, ubicacion As String
            articulo = valor(1)
            ubicacion = valor(0)

            Dim contNegocio As New ConteoNegocio
            Dim conteo As New Conteo
            Dim Empresa As String = "01" 'Variables.Empresa.gCIA_Codigo
            conteo = contNegocio.ConsultarConteo(Empresa, nroConteo, articulo, ubicacion)

            If Not conteo Is Nothing Then
                TextBox2.Text = conteo.gCONT_Grupo
                TextBox3.Text = conteo.gCONT_Cantidad
            End If
            TextBox2.Focus()
        End If
    End Sub

    Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox3.KeyPress
        If Char.IsNumber(e.KeyChar) Or Char.IsPunctuation(e.KeyChar) Then
            e.Handled = False
        Else
            e.Handled = True
        End If
    End Sub

End Class